home *** CD-ROM | disk | FTP | other *** search
/ GameStar 2004 April / Gamestar_61_2004-04_dvdb.iso / DVDStar / Editace / hltp.exe / {app} / Source Code / MAP Viewer / Config.h < prev    next >
C/C++ Source or Header  |  2003-10-09  |  3KB  |  143 lines

  1. /*
  2. Half-Life MAP viewing utility.
  3. Copyright (C) 2003  Ryan Samuel Gregg
  4.  
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 2 of the License, or
  8. (at your option) any later version.
  9.  
  10. This program is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13. GNU General Public License for more details.
  14.  
  15. You should have received a copy of the GNU General Public License
  16. along with this program; if not, write to the Free Software
  17. Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  18. */
  19.  
  20. #pragma once
  21.  
  22. #include "Types.h"
  23.  
  24. namespace RenderMode
  25. {
  26.     __value enum RenderMode { Textured, Solid, WireFrame, Points };
  27. }
  28.  
  29. namespace TextureFilter
  30. {
  31.     __value enum TextureFilter { Nearest, Linear, MipNearest, MipLinear, MipBilinear, MipTrilinear, MipIsotropic, MipAnisotropic };
  32. }
  33.  
  34. namespace FogMode
  35. {
  36.     __value enum FogMode { Exp, Exp2, Linear };
  37. }
  38.  
  39. __gc class CConfig
  40. {
  41. public:
  42.     int iRecentMAPCount;
  43.  
  44.     unsigned char bColorBits;
  45.     unsigned char bDepthBits;
  46.  
  47.     Color4f cBackColor;
  48.     Color4f cForeColor;
  49.     Color4f cHighlightColor;
  50.     Color4f cOutlineColor;
  51.  
  52.     float fFrustumFieldOfView;
  53.     float fFrustumZNear;
  54.     float fFrustumZFar;
  55.  
  56.     bool bFog;
  57.     Color4f cFogColor;
  58.     float fFogDensity;
  59.     float fFogStart;
  60.     float fFogEnd;
  61.     FogMode::FogMode eFogMode;
  62.  
  63.     bool bInvertCamera;
  64.     float fCameraSpeed;
  65.     float fCameraBoost;
  66.  
  67.     bool bDrawSpecialTextures;
  68.     bool bDrawSelection;
  69.     bool bDrawPointFile;
  70.     bool bOutlineScene;
  71.     bool bLightScene;
  72.     RenderMode::RenderMode eRenderMode;
  73.     TextureFilter::TextureFilter eTextureFilter;
  74.  
  75.     String *sHalfLifePath;
  76.  
  77. public:
  78.     CConfig()
  79.     {
  80.         iRecentMAPCount = 8;
  81.  
  82.         bColorBits = 32;
  83.         bDepthBits = 32;
  84.  
  85.         cBackColor.R = 0.0f;
  86.         cBackColor.G = 0.0f;
  87.         cBackColor.B = 0.0f;
  88.         cBackColor.A = 0.0f;
  89.  
  90.         cForeColor.R = 1.0f;
  91.         cForeColor.G = 1.0f;
  92.         cForeColor.B = 1.0f;
  93.         cForeColor.A = 1.0f;
  94.  
  95.         cHighlightColor.R = 1.0f;
  96.         cHighlightColor.G = 0.5f;
  97.         cHighlightColor.B = 0.0f;
  98.         cHighlightColor.A = 1.0f;
  99.  
  100.         cOutlineColor.R = 1.0f;
  101.         cOutlineColor.G = 1.0f;
  102.         cOutlineColor.B = 1.0f;
  103.         cOutlineColor.A = 1.0f;
  104.  
  105.         fFrustumFieldOfView = 70.0f;
  106.         fFrustumZNear = 1.0f;
  107.         fFrustumZFar = 8192.0f;
  108.  
  109.         bFog = false;
  110.         cFogColor.R = 0.0f;
  111.         cFogColor.G = 0.0f;
  112.         cFogColor.B = 0.0f;
  113.         cFogColor.A = 1.0f;
  114.         fFogDensity = 0.20f;
  115.         fFogStart = 2048.0f;
  116.         fFogEnd = 8192.0f;
  117.         eFogMode = FogMode::Linear;
  118.  
  119.         bInvertCamera = false;
  120.         fCameraSpeed = 2.0f;
  121.         fCameraBoost = 4.0f;
  122.  
  123.         bDrawSpecialTextures = false;
  124.         bDrawSelection = true;
  125.         bDrawPointFile = true;
  126.         bLightScene = false;
  127.         bOutlineScene = false;
  128.         eRenderMode = RenderMode::Textured;
  129.         eTextureFilter = TextureFilter::MipTrilinear;
  130.  
  131.         sHalfLifePath = S"";
  132.     }
  133.  
  134.     Object *ReadKey(Microsoft::Win32::RegistryKey *Base, String *Path, String *Variable)
  135.     {
  136.         if((Base = Base->OpenSubKey(Path, false)) == NULL)
  137.         {
  138.             return NULL;
  139.         }
  140.  
  141.         return Base->GetValue("InstallPath");
  142.     }
  143. };